package ast;

import src.NFA;

public class UnionNode extends ASTNode {
	

	public UnionNode(ASTNode leftChild, ASTNode rightChild) {
		// Store each node as the left child and right child
		this.leftChild = leftChild;
		this.rightChild = rightChild;
		this.value = leftChild.getValue() + "|" + rightChild.getValue();
		}
	
	@Override
	public NFA generateNFA() {
		
		return NFA.union(this.leftChild.generateNFA(),this.rightChild.generateNFA());
	}

}
